Carbon


GetThemeMenuBarHeight

Header: Appearance.h Carbon status: Supported

Obtains the height of a menu bar.

OSStatus GetThemeMenuBarHeight (
    SInt16 *outHeight
);
outHeight

A pointer to a signed 16-bit integer. On return, the integer value represents the height (in pixels) of the menu bar.

function result

A result code.

DISCUSSION

The GetThemeMenuBarHeight function obtains the specified height of a menu bar in the current theme. This is in contrast to the Menu Manager function GetMBarHeight, which obtains the actual space that the menu bar is currently occupying on the screen. In most instances, the values produced by these two functions are the same. But, when the menu bar is hidden, GetMBarHeight produces a value of 0, and GetThemeMenuBarHeight still provides the “ideal” menu bar height.

SPECIAL CONSIDERATIONS

Because menu bar heights may vary among appearances by one or more pixels, you should check the current menu bar height after a theme switch. Specifically, your application should respond to the theme-switch Apple event, kAEAppearanceChanged, by checking the current menu bar height. See “Appearance Manager Apple Event Constants” for more details on kAEAppearanceChanged.

It is important to check the menu bar height before positioning any windows. Failure to do so may result in the menu bar overlapping your application’s windows.

VERSION NOTES

This function is available with Appearance Manager 1.0.1 and later.

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)